From: Florian Müllner Date: Sun, 15 Sep 2019 00:51:40 +0000 (+0200) Subject: background: Add exception to no-loop-func rule X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~781^2^2~414 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=66fc5c07bb950fee0e7d87d0b09af9a04c2efe01;p=gnome-shell.git background: Add exception to no-loop-func rule Modifying variables from an outer scope in functions created in a loop is considered problematic by eslint, because the variable value in the resulting closure is often not what the coder intended. In this particular case however, the scoping is correct, so add a comment to disable the rule locally. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/818 --- diff --git a/js/ui/background.js b/js/ui/background.js index 4d5d13249..f7506dec4 100644 --- a/js/ui/background.js +++ b/js/ui/background.js @@ -403,6 +403,7 @@ var Background = GObject.registerClass({ if (numPendingImages == 0) finish(); } else { + // eslint-disable-next-line no-loop-func let id = image.connect('loaded', () => { image.disconnect(id); numPendingImages--;